# # CMakeLists.txt
if (DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
    set(CMAKE_TOOLCHAIN_FILE "/mnt/d/ProjectWorkspace/unitree-robot-projects/softwares/realsense-d435i/vcpkg/scripts/buildsystems/vcpkg.cmake"
        CACHE STRING "Vcpkg toolchain file")
endif()

cmake_minimum_required(VERSION 3.16)

project(helloworld)

# Set C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 优先使用静态链接
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})

# Find required packages
find_package(fmt CONFIG REQUIRED)

# Create executable
add_executable(helloworld helloworld.cpp)

# Link libraries - 明确使用静态库
target_link_libraries(helloworld PRIVATE fmt::fmt-header-only)